#pragma once

#include <QObject>
#include "khttpmanager.h"


class DownloadThreadTask  : public QObject
{
	Q_OBJECT

public:
	explicit DownloadThreadTask(const QString& saveFileName, const QString& mp3URL,QObject *parent = Q_NULLPTR);
	~DownloadThreadTask();


public slots:
	void onHandleTask();

	void onDownloadProgress(qint64 byteRecieve, qint64 byteTotal);

signals:
	void progressUpdated(int pr);
	void taskFinished();

private:
	QString m_fileName;
	QString m_downloadURL;
	KHttpManager* m_manager = nullptr;
};
